<?php
use yii\helpers\Url;
use app\common\widgets\Page;
use yii\widgets\LinkPager;
?>
<section class="vbox">
	<header class="header bg-white b-b clearfix">
		<p>权限管理</p>
	</header>
	<section class="scrollable wrapper w-f">
		<section class="panel panel-default">
			<header class="panel-heading bg-light">
				<ul class="nav nav-tabs">
					<li >
						<a href="<?php echo \Yii::$app->urlManager->createUrl("user/lists"); ?>">用户管理</a>
					</li>
					<li class="active">
						<a href="#classify">角色管理</a>
					</li>
				</ul>
			</header>
			<div class="panel-body">
				<div class="tab-content">
					<div class="tab-pane active" id="classify" style="overflow-x:hidden">
						<form class="talbe-search form-inline" method="post" action="/api/Page/list">
							<div class="row m-t-sm">
								<div class="col-sm-9 m-b-xs">
									<div class="form-group">
										<div class="btn-group">
											<button type="button" data-toggle="refresh" class="btn btn-sm btn-default" title="刷新"> <i class="fa fa-refresh"></i>
											</button>
											<button type="button" class="btn btn-sm btn-default" title="删除" data-toggle="batch" data-href="/api/Form/allRemove" disabled> <i class="fa fa-trash-o"></i>
											</button>
										</div>
										<a href="<?php echo \Yii::$app->urlManager->createUrl("role/add"); ?>" class="btn btn-default btn-sm">
											<i class="fa fa-plus text-muted m-r-xs"></i>
											添加角色
										</a>
									</div>

								</div>

							</div>
							<input type="hidden" name="pageNumber" id="pageNumber" value="1" />
							<input type="hidden" name="orderBy" id="orderBy" value="desc" />
							<input type="hidden" name="order" id="order" value="Name" />
						</form>

						<section class="panel panel-default m-t-md">
							<div class="table-responsive">
								<table class="table table-striped b-t b-light">
									<thead>
									<tr>
										<th style="width:20px;"><label class="checkbox m-n i-checks"><input type="checkbox"><i></i></label></th>
										<th>编号</th>
										<th>名称</th>
										<th>状态</th>
										<th>操作</th>
									</tr>
									</thead>
									<tbody>
									<?php foreach((array)$data as $key=>$info):?>
										<tr id="list_<?php echo $info['id'];?>">
											<td><label class="checkbox m-n i-checks"><input type="checkbox" name="check"  value="<?php echo $info['id'];?>"><i></i></label></td>
											<td><?php echo $info['id'];?></td>
											<td><?php echo $info['name'];?></td>
											<td>
												<?php if($info['status'] == 1){?>
													<span class="label bg-success">启用</span>
												<?php }else {?>
													<span class="label bg-danger">停用</span>
												<?php }?>
											</td>
											<td>
												<a href="<?php echo Url::toRoute(['role/edit', 'id' => $info['id']]);?>" title="编辑"><i class="fa  fa-pencil-square-o text-muted"></i></a>
												<a href="<?php echo Url::toRoute(['role/dodel', 'id' => $info['id']]);?>" data-toggle="ajaxRemove" data-msg="确定删除此 <font color='red'><?php echo $info['name'];?></font>？" class="" title="删除">
													<i class="fa fa-trash-o text-muted"></i>
												</a>
											</td>
										</tr>
									<?php endforeach?>

									</tbody>
								</table>
							</div>
						</section>

					</div>
				</div>
			</div>
		</section>
	</section>

	<footer class="footer bg-white b-t" data-type="ajaxPage">
		<div class="row text-center-xs">
			<div class="col-md-6 hidden-sm">
				<p class="text-muted m-t">总共<?php echo $total;?>条 当前为第<?php echo $filter['page'];?>页</p>
			</div>
			<div class="col-md-6 col-sm-12 text-right text-center-xs">
				<?php if($total > 0):echo Page::model(array('count'=>$total,'size'=>$limit))->show("NewPage");endif;?>
			</div>
		</div>
	</footer>
</section>
